<%@ page import="rentadomus.Contract" %>



<div class="fieldcontain ${hasErrors(bean: contractInstance, field: 'monthlyRentFee', 'error')} required">
	<label for="monthlyRentFee">
		<g:message code="contract.monthlyRentFee.label" default="Monthly Rent Fee" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="monthlyRentFee" value="${fieldValue(bean: contractInstance, field: 'monthlyRentFee')}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: contractInstance, field: 'rentPayDate', 'error')} required">
	<label for="rentPayDate">
		<g:message code="contract.rentPayDate.label" default="Rent Pay Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="rentPayDate" precision="day"  value="${contractInstance?.rentPayDate}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: contractInstance, field: 'person', 'error')} required">
	<label for="person">
		<g:message code="contract.person.label" default="Person" />
		<span class="required-indicator">*</span>
	</label>
	<!--<g:select id="person" name="person.id" from="${rentadomus.Person.list()}" optionKey="id" required="" value="${contractInstance?.person?.id}" class="many-to-one"/>-->
	<g:textField id="person" name="person.identification" value="${contractInstance?.person?.identification}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: contractInstance, field: 'place', 'error')} required">
	<label for="place">
		<g:message code="contract.place.label" default="Place" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="place" name="place.id" from="${places}" optionKey="id" required="" value="${contractInstance?.place?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: contractInstance, field: 'rules', 'error')} ">
	<label for="rules">
		<g:message code="contract.rules.label" default="Rules" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${contractInstance?.rules?}" var="r">
  <li><g:link controller="behaviourRule" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link></li>
</g:each>
<!--<li class="add">
<g:link controller="behaviourRule" action="create" params="['contract.id': contractInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'behaviourRule.label', default: 'BehaviourRule')])}</g:link>
</li>
</ul>-->

</div>

